package naga.x.platform2.channel.yooh5.support;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.alibaba.fastjson.JSON;

import naga.x.platform2.App;

@Configuration
@EnableAutoConfiguration
@ConfigurationProperties(locations = "classpath:yooh5.properties")
public class Yooh5Config implements InitializingBean {

	private String appId;
	private String appKey;
	private String reqUserUrl = "http://game.yooh5.com/user/getInfo";

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getAppKey() {
		return appKey;
	}

	public void setAppKey(String appKey) {
		this.appKey = appKey;
	}

	public String getReqUserUrl() {
		return reqUserUrl;
	}

	public void setReqUserUrl(String reqUserUrl) {
		this.reqUserUrl = reqUserUrl;
	}
	
	@Override
	public String toString() {
		return "[appId=" + appId + ", appKey=" + appKey + ", reqUserUrl=" + reqUserUrl + "]";
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		App.LOG.info("[YOOH5 CONFIG LOADED]{}", this);
	}

}
